Computing devices are initialized by firmware included within the device and this firmware provides a range of software services which facilitate the boot of the operating system (OS) as well as providing a smaller subset of these services that continue to be available after the operating system has booted. Firmware is software that has been written onto Read-Only Memory (ROM) modules including, but not limited to, ROM, PROM, EPROM, EEPROM, and Flash ROM (collectively referred to hereafter as “ROM”). Among other services, the firmware is responsible for operation of the computing device until a boot process can be run which loads an operating system for the computing device into memory. Once loaded, the operating system is in charge of normal operation of the computing device although the provision of certain services after loading of the operating system may require a transition of control from the operating system back to the firmware for security and other reasons. For example, some firmware is only executable after a computing device has been transitioned from a normal operating mode controlled by the operating system to a secure execution environment controlled by the firmware.
One example of such a secure execution environment is System Management Mode (SMM). A computing device may contain one or more elements known as Central Processing Units (CPUs). Each CPU may have more than one core. These CPUs and CPU cores may have a normal operating mode and a second operating mode called SMM. When the CPU or core is in normal operating mode (when the computing device is being controlled by the operating system) it can access all elements of the computer except certain memory regions exclusively dedicated to SMM. In contrast, when the CPU or core is operating in SMM it is able to access all elements of the computing device including the memory locations allocated for SMM. The CPU or core may be directed to transition from normal operating mode to SMM by a number of triggers called System Management Interrupts (SMI) events. The exact triggers available differ somewhat from among system designs but the result of an SMI being triggered is that execution in main memory is immediately suspended and execution begins at a specific location in SMM protected memory. The secure execution environment provided by SMM allows secure services and applications to execute while being protected from examination by code executing in normal system memory or by hardware devices using Direct Memory Access (DMA). Computing devices supporting the x86 system architecture frequently provide support for SMM. Similar types of secure execution environments may be provided in other platforms such as TrustZone™ in computing devices employing an ARM processor.
Unified Extensible Firmware Interface (UEFI) is a specification created by a non-profit industry body detailing a programming interface between the Operating System and the included firmware of a computing device such as, but not limited to, a Personal Computer (PC). UEFI specifications describe a set of tools by which a computing device can move in an organized fashion from the power-applied state to fully operational. The UEFI specification tells the desired result but deliberately does not specify the internal tactic of implementation. The UEFI firmware specification replaces earlier operating system (OS)/firmware interfaces previously used by the industry and commonly known as legacy BIOS (Basic Input Output System).
When implemented in a computing device, the machine codes for UEFI firmware and all permanent data used by the firmware reside in ROM. In many cases the ROM is an Electrically Erasable silicon device known as a flash ROM. Flash ROM has the characteristic that it can be erased by electrical command and individual elements may then be written and the flash ROM device will retain the data indefinitely. When power is first applied to the computing device, the device executes a process called reset which clears the state to a known condition and begins execution of the firmware controlling the boot sequence. The firmware is read from the ROM.